React materials theming system
lets you customize color, and add different
variants of typography, and also enables you to specify constant spacing in
your application. You can use pre-built
theme variables like palette, typography,
spacing, etc. that lets you apply a
consistent tone to your app. It allows you to customize
all design aspects of your project to meet the specific needs of
your business or brand. Each theme includes
three palettes that determine component colors, a primary palette is
the color palette that appears most frequently
throughout your application. An accent or secondary
palate is used to selectively highlight the
critical parts of your UI, and a warn or error palette is used for warnings
and error states. A palette is a
collection of colors representing a portion
of the color space, each value in this
collection is called a hue. In material design, each hue and a palette
has an identifier number. Each identifier number
includes the 50th value, and then each 100th value, between 100 and 900. The numbers refer to hues within a palette from the lightest
to the darkest colors. The typography component
makes it easy to apply a default set of font weights and sizes in your application. The typography component uses
the variant mapping prompt to associate a UI variant
with a semantic element. Material user interface or MUI default typography
configuration only relies on 300, 400, 500, and 700 font weights. There are several
typography variant options in theme object like h1, h2, subtitle 1, body, etc. In default theme prompts, the light and dark theme
types are available to choose from and promote greater
consistency between apps. By default, components
use the light theme type. You can use the
default or inbuilt material theme object
using styled-components or existing custom styling application
programming interfaces or APIs, such as width styles
and make styles. You can use several options from theme objects to globally
maintain a consistent style, such as spacing, palette, typography, breakpoints, etc. The code on the slide generates
the output on the screen. If you wish to
customize the theme, you need to use the
theme provider component to inject a theme into
your application. You need to pass
theme provider as a parent of the
components you customize. The code on the slide generates
the output on the screen.